<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">

		<title></title>
		<link rel="stylesheet" href="../css/bootstrap.min.css"/>
		<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script><script type="text/javascript" src="../plugins/jquery.min.js"></script>
		<script type="text/javascript" src="../bootstrap.min.js"></script>
		<script type="text/javascript" src="../plugins/lightbox2/js/lightbox.js"></script>
		<script type="text/javascript" src="../layui.all.js"></script>

		<script src="particles.js"  type="text/javascript" charset="utf-8"></script>
		<style>
	body{color:#fff; font-family:"微软雅黑"; font-size:14px;}
	.wrap1{position:absolute; top:0; right:0; bottom:0; left:0; margin:auto }/*把整个屏幕真正撑开--而且能自己实现居中*/
	.main_content{background:url(/img/main_bg.png) repeat; margin-left:auto; margin-right:auto; text-align:left; float:none; border-radius:8px;}
	.form-group{position:relative;}
	.login_btn{display:block; background:#3872f6; color:#fff; font-size:15px; width:100%; line-height:50px; border-radius:3px; border:none; }
	.login_input{width:100%; border:1px solid #3872f6; border-radius:3px; line-height:40px; padding:2px 5px 2px 30px; background:none;}
	.icon_font{position:absolute; bottom:15px; left:10px; font-size:18px; color:#3872f6;}
	.font16{font-size:16px;}
	.mg-t20{margin-top:20px;}
	@media (min-width:200px){.pd-xs-20{padding:20px;}}
	@media (min-width:768px){.pd-sm-50{padding:50px;}}
	#grad {
	  background: -webkit-linear-gradient(#4990c1, #52a3d2, #6186a3); /* Safari 5.1 - 6.0 */
	  background: -o-linear-gradient(#4990c1, #52a3d2, #6186a3); /* Opera 11.1 - 12.0 */
	  background: -moz-linear-gradient(#4990c1, #52a3d2, #6186a3); /* Firefox 3.6 - 15 */
	  background: linear-gradient(#4990c1, #52a3d2, #6186a3); /* 标准的语法 */
	}
</style>

	</head>
	<body  id="particles-js" style="background: url(/img/bg.jpg) no-repeat;">

			<form action="" id="form" method="post">
				<div class="container wrap1" style="height:450px;">
					<h2 class="mg-b20 text-center">修车师父后台</h2>
					<div class="col-sm-8 col-md-5 center-auto pd-sm-50 pd-xs-20 main_content">
						<p class="text-center font16">管理员后台登陆</p>

							<div class="form-group mg-t20">
								<i class="icon-user icon_font"></i>
								<input type="text" name="username"  class="login_input" id="username" placeholder="请输入用户名" />
							</div>
							<div class="form-group mg-t20">
								<i class="icon-lock icon_font"></i>
								<input type="password" class="login_input"  name="password" id="password" placeholder="请输入密码" />
							</div>
							<button style="submit" class="login_btn">登 录</button>

					</div><!--row end-->
				</div><!--container end-->



			</form>
		<script type="text/javascript">
		if (window.location != window.top.location) {
			window.top.location = window.location;
		}
			$(function(){

				$(window).on('resize',function(){
					$('body').width($(window).width());
					$('body').height($(window).height());
				});

				$('#form').submit(function(e) {
					$.ajax({
						type: "POST",
						url: "user/user/adminLogin",
						data: new FormData($(this)[0]), // serializes the form's elements.
						cache: false,
						contentType: false,
						processData: false,
						success: function(data) {
							if(data) {
								var rel = data.rel;
								if(rel){
									layui.use('layer', function() {
										var layer = layui.layer;

										layer.msg(data.msg,function() {
											location = "admin/index";
										})
									})
								} else {
									layui.use('layer', function() {
										var layer = layui.layer;
										layer.msg(data.msg)
									})
								}

							} else {
								// alert("登陆失败");
								layui.use('layer', function() {
									var layer = layui.layer;
									layer.msg('登陆失败', {
										icon: 5
									})
								})
							}

						}
					});
					e.preventDefault();
				});
			})



particlesJS.load('particles-js','/datas/package.json', function() {
  console.log('callback - particles.js config loaded');
});
		</script>
	</body>
</html>
